﻿using Special_Item;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SeparateProjects
{
    public partial class Pro_Admin_Index : Form
    {
        #region  为窗体命名
        public Pro_Admin_ChangePassword P1;
        public Pro_Admin_AdditionalParticipants P2;
        public Pro_AdminGradeSearch P3;
        public Pro_Admin_Name_Search P4;
        public Pro_Admin_Student_List P5;
        public Pro_Admin_Subject_List P6;
        public Pro_Admin_help P7;
        #endregion
        #region  构造传递参数
        /// <summary>
        /// 构造传参
        /// </summary>
        /// <param name="Accounts"></param>
        public Pro_Admin_Index(string Accounts)
        {
            InitializeComponent();
            this.lbl_Accounts.Text = Accounts;
        }
        #endregion
        #region  预加载事件，加载信息
        private void Pro_Admin_Index_Load(object sender, EventArgs e)
        {
            P1 = new Pro_Admin_ChangePassword(this.lbl_Accounts.Text);
            P2 = new Pro_Admin_AdditionalParticipants();
            P3 = new Pro_AdminGradeSearch();
            P4 = new Pro_Admin_Name_Search();
            P5 = new Pro_Admin_Student_List();
            P6 = new Pro_Admin_Subject_List();
            P7 = new Pro_Admin_help();
        }
        #endregion
        #region  修改管理员密码
        /// <summary>
        /// 修改管理员密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Admin_ChangePassword_Click(object sender, EventArgs e)
        {
            Pro_Admin_ChangePassword P1 = new Pro_Admin_ChangePassword(this.lbl_Accounts.Text);
            P1.Show();
            P1.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P1);
        }
        #endregion
        #region  退出程序
        /// <summary>
        /// 退出程序
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Exit_Program_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确认退出","提示信息",
                                                MessageBoxButtons.OKCancel,
                                                MessageBoxIcon.Information);
            if (dr.Equals(DialogResult.OK))
            {
                //退出程序
                Application.Exit();
            }
        }
        #endregion
        #region  添加用户
        /// <summary>
        /// 跳转添加用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AdditionalParticipants_Click(object sender, EventArgs e)
        {
            Pro_Admin_AdditionalParticipants P2 = new Pro_Admin_AdditionalParticipants();
            P2.Show();
            P2.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P2);
        }
        #endregion
        #region  按年级查找学生信息
        /// <summary>
        /// 按年级查找
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GradeSearch_Click(object sender, EventArgs e)
        {
            Pro_AdminGradeSearch P3 = new Pro_AdminGradeSearch();
            P3.Show();
            P3.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P3);
        }
        #endregion
        #region  按姓名查找学生信息
        /// <summary>
        /// 按名字查找
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NameSearch_Click(object sender, EventArgs e)
        {
            Pro_Admin_Name_Search P4 = new Pro_Admin_Name_Search();
            P4.Show();
            P4.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P4);
        }
        #endregion
        #region  学生列表
        /// <summary>
        /// 学生列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudentList_Click(object sender, EventArgs e)
        {
            Pro_Admin_Student_List P5 = new Pro_Admin_Student_List();
            P5.Show();
            P5.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P5);
        }
        #endregion
        #region  科目列表
        /// <summary>
        /// 科目列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubjectManagement_Click(object sender, EventArgs e)
        {
            Pro_Admin_Subject_List P6 = new Pro_Admin_Subject_List();
            P6.Show();
            P6.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P6);
        }
        #endregion
        #region  帮助关于
        /// <summary>
        /// 帮助关于
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Help_Click(object sender, EventArgs e)
        {
            Pro_Admin_help P7 = new Pro_Admin_help();
            P7.Show();
            P7.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(P7);
        }
        #endregion 
        #region 点击实现字体切换
        /// <summary>
        /// 点击时，字体切换成黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Accounts_Click(object sender, EventArgs e)
        {
            this.Accounts.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 点击时，字体切换成黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudentAccounts_Click(object sender, EventArgs e)
        {
            this.StudentAccounts.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 点击时，字体切换成黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudySubjects_Click(object sender, EventArgs e)
        {
            this.StudySubjects.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 点击时，字体切换成黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Aid_Click(object sender, EventArgs e)
        {
            this.Aid.ForeColor = Color.FromArgb(0, 0, 0);
        }
        #endregion
        #region  鼠标移上去字体变色
        /// <summary>
        /// 鼠标移上去字体变黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Accounts_MouseHover(object sender, EventArgs e)
        {
            this.Accounts.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 鼠标移上去字体变黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudentAccounts_MouseHover(object sender, EventArgs e)
        {
            this.StudentAccounts.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 鼠标移上去字体变黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudySubjects_MouseHover(object sender, EventArgs e)
        {
            this.StudySubjects.ForeColor = Color.FromArgb(0, 0, 0);
        }
        /// <summary>
        /// 鼠标移上去字体变黑色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Aid_MouseHover(object sender, EventArgs e)
        {
            this.Aid.ForeColor = Color.FromArgb(0, 0, 0);
        }
        #endregion
        #region  移开鼠标变色
        /// <summary>
        /// 鼠标移开字体变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Accounts_MouseLeave(object sender, EventArgs e)
        {
            this.Accounts.ForeColor = Color.White;
        }
        /// <summary>
        /// 鼠标移开字体变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudentAccounts_MouseLeave(object sender, EventArgs e)
        {
            this.StudentAccounts.ForeColor = Color.White;
        }
        /// <summary>
        /// 鼠标移开字体变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StudySubjects_MouseLeave(object sender, EventArgs e)
        {
            this.StudySubjects.ForeColor = Color.White;
        }
        /// <summary>
        /// 鼠标移开字体变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Aid_MouseLeave(object sender, EventArgs e)
        {
            this.Aid.ForeColor = Color.White;
        }
        #endregion
    }
}
